﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ConferenceArranger.BusinessRules;

namespace ConferenceArranger.ConferenceComponent
{
    /// <summary>
    /// A talk has title, interval and start time
    /// </summary>
    class Talk
    {   
        private string title;
        private int interval;
        private DateTime startTime;

        public Talk(string title, int interval)
        {
            this.title = title;
            this.interval = interval;
        }

        public string GetTitle()
        {
            return title;
        }

        public int GetInterval()
        {
            return interval;
        }

        public DateTime GetStartTime()
        {
            return startTime;
        }

        public void SetTitle(string title)
        {
            this.title = title;
        }

        public void SetInterval(int interval)
        {
            this.interval = interval;
        }

        public void SetStartTime(DateTime startTime)
        {
            this.startTime = startTime;
        }

        public string ToString()
        {
            if (this.interval > 5)
                return SessionHelper.ConvertTimeFormat(GetStartTime()) + " " +  GetTitle() + " " +                                                GetInterval() + "min";
            else return SessionHelper.ConvertTimeFormat(GetStartTime()) + " " + GetTitle() + " " +                                                 "lightning";
        }
    }
}
